#include <iostream>
#include <cstring>

using namespace std;

class MyClass
{
private:
    char *data;

public:
    // 构造函数
    MyClass(const char *str)
    {
        data = new char[strlen(str) + 1];
        strcpy(data, str);
    }
    // 拷贝构造函数（深拷贝）
    MyClass(const MyClass &other)
    {
        data = new char[strlen(other.getData()) + 1];
        strcpy(data, other.data);
    }
    // 赋值构造函数
    MyClass &operator=(const MyClass &other)
    {
        if (this != &other)
        {
            delete[] data;
            data = new char(strlen(other.getData()) + 1);
            strcpy(data, other.getData());
        }
        return *this;
    }
    char *getData() const
    {
        return data;
    }
};

int main()
{
    return 0;
}